Conversation
labkey-jeckels
left a comment
There was a problem hiding this comment.
The bug was in how we handled the SQL for an invalid pivot query. The query here looks like it's been fixed and is running successfully.
To ensure that we cover the original issue, please remove F1 from the SELECT list and ensure that you get a reasonable error message instead of a NullPointerException. It's fine to also check the corrected version of the query as you're doing here.
labkey-jeckels
left a comment
There was a problem hiding this comment.
Thanks for the update. This looks fine. FWIW, uou could also have used the executeSql API which would be a little more efficient.
| public void testBadPivotQuery() | ||
| { | ||
| String datasetName = TestDataGenerator.randomDomainName("D2", DomainUtils.DomainKind.StudyDatasetVisit); | ||
| String textFieldName = TestDataGenerator.randomFieldName("F1", ":,;'\""); |
There was a problem hiding this comment.
Is there a particular reason you are excluding these :,;'\" characters?
TestDataGenerator.randomFieldName will select a valid field name for a given domain:
public static String randomFieldName(@NotNull String part, @Nullable Integer numStartChars, @Nullable Integer numEndChars, @Nullable String exclusion, @Nullable DomainUtils.DomainKind domainKind)
There was a problem hiding this comment.
I used those in an earlier test like this one, probably shouldn't here. I'll pull those out.
Rationale
This adds test coverage for Issue 52739
Related github issue https://github.com/LabKey/kanban/issues/949
Related Pull Requests
n/a
Changes
New test method in
PivotQueryTest.java